<?php
error_reporting(E_ALL & ~E_NOTICE);
if(isset($_GET[oid])){
	$oid = $_GET[oid];
}
if(isset($_GET[id])){
	$id = $_GET[id];
 	require_once("action/sys_conf.inc");
	
	$link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD);
	mysql_select_db($DBNAME);
	mysql_query("SET NAMES 'utf8'");
	$sql = "select id,subjectItemId,title,path,mediaType,listVisible from extpollmedia where id='$id' order by id desc";
	$result = mysql_query($sql);
	$media = mysql_fetch_assoc($result);
	$id == $media['id'];
	$oid = $media['subjectItemId'];
	$title = $media['title'];
	$path = $media['path'];
	$mediaType = $media['mediaType'];
	$listVisible = $media['listVisible'];
}
?>
<form action="action/pollMediaAdd.php" method="post" enctype="multipart/form-data" target="submit" onsubmit="javascript:$('#iframe2').hide();iframe(1,'poll_option_add.php?oid=<?php echo $oid ?>')">
<input type="hidden" name="media[oid]" value="<?php echo $oid ?>" />
<input type="hidden" name="media[id]" value="<?php echo $id ?>" />
<div class="from-row">
	<label class="required">标题：</label>
	<div class="content"><input type="text" name="media[title]" value="<?php echo $title ?>"/></div>
</div>
<div class="from-row">
	<label class="required">路径：</label>
	<div class="content"><input type="file" name="media[path]"  value="<?php echo $path ?>"/></div>
</div>
<div class="from-row">
		<label class="required">类型：</label>
		<div class="content"><input type="radio" name="media[mediaType]" value="0" <?php if($mediaType == 0){ echo 'checked="checked"';} ?>/>图片&emsp;&emsp;<input type="radio" name="media[mediaType]" value="1" <?php if($mediaType == 1){ echo 'checked="checked"';} ?>/>视频&emsp;&emsp;<input type="radio" name="media[mediaType]" value="2" <?php if($mediaType == 2){ echo 'checked="checked"';} ?>/>flash</div>
</div>
<div class="from-row">
		<label class="required">列表页显示：</label>
		<div class="content"><input type="radio" name="media[listVisible]" value="1" <?php if($listVisible == 1 || $listVisible == null){ echo 'checked="checked"';} ?> />是&emsp;&emsp;<input type="radio" name="media[listVisible]" value="0"  <?php if($listVisible == 0 && $listVisible !== null){ echo 'checked="checked"';} ?> />否</div>
</div>
<div class="from-row">
	<input name="submitPoll" type="submit" value="提交" />
	<input name="cancel" type="button" value="取消" onclick="javascript:$('#iframe2').hide();" />
</div>
</form>
<iframe name="submit" style="display:none"></iframe>
